// 对应登录注册部分
window.onload=function(){
   var linkbt=document.getElementById("linkbt");
   var page=document.getElementById('page');
   var fade=document.getElementById('fade');
   var closebt=document.getElementById("closebt");

   var loginbt=document.getElementById("loginbt");
   var login=document.getElementById("login");
   var loginpart=document.getElementById("login_part");
   var findm=document.getElementById("findm");
   var theme=document.getElementById('theme');
   var closebt_two=document.getElementById("closebt_two");
  // findm.style.display="none";
  // click_login.style.display="none";
   linkbt.onclick=function(){
     page.style.display='block';
     fade.style.display='block';
   }
   closebt.onclick=function(){
     page.style.display='none';
     fade.style.display='none';

   }

   loginbt.onclick=function(){

        login.style.display='block';
        theme.style.display='block';

   }
   closebt_two.onclick=function(){
     login.style.display='none';
     theme.style.display='none';
       loginpart.style.display='block';
       findm.style.display='none';
   }

   // 点击忘记密码之后的行为
   	var finddatabt=document.getElementById('finddatabt');
	finddatabt.onclick=function(){
		findm.style.display="block";
		login_part.style.display="none";
		}
	// 点击注册行为
	var click_login=document.getElementById('click_login');
	var click_login_bt=document.getElementById('click_login_bt');
	click_login_bt.onclick=function(){
		click_login.style.display="block";
		login_part.style.display="none";
	}

  // 点击重置之后
  
   } 
// 对应注册界面点击事件
function validate() {
  var pw1 = document.getElementById("pw1").value;
  var pw2 = document.getElementById("pw2").value;
  var numb = document.getElementById("numb").value;
  if (pw1=="") {
  	  document.getElementById("tishi").innerHTML="<font color='red'>请输入密码</font>";
  }
  else if(pw1 == pw2) {
      document.getElementById("tishi").innerHTML=" ";
      document.getElementById("submit").disabled = false;
  }
  else{
      document.getElementById("tishi").innerHTML="<font color='red'>两次密码不相同</font>";
    document.getElementById("submit").disabled = true;
  }
  if (numb=="") {
  	document.getElementById("numbts").innerHTML="<font color='red'>请输入您的电话号码</font>";
  	document.getElementById("submit").disabled = false;
  }
  else {
      document.getElementById("numbts").innerHTML="";
    document.getElementById("submit").disabled = true;
  }
}
// 点击注册部分
 function validateclick() {
  var pw3 = document.getElementById("pw3").value;
  var pw4 = document.getElementById("pw4").value;
  var numb1 = document.getElementById("numb1").value;
  var submit1 = document.getElementById("submit1");
  if (pw3=="") {
  	  document.getElementById("tishi1").innerHTML="<font color='red'>请输入密码</font>";
  	}
  else if(pw3 == pw4) {
      document.getElementById("tishi1").innerHTML="";
      submit1.disabled = false;
  }
  else {
      document.getElementById("tishi1").innerHTML="<font color='red'>两次密码不相同</font>";
      submit1.disabled = true;
  }
  if (numb1=="") {
  	document.getElementById("numbts1").innerHTML="<font color='red'>请输入您的电话号码</font>";
      submit1.disabled = false;
  }
  else {
      document.getElementById("numbts1").innerHTML="";
      submit1.disabled = true;
  }
  //注册成功
     submit1.onclick = function(){
         page.style.display='none';
         login.style.display='block';
     }
}

function anew(){ 
  var anewpassword = document.getElementById("anewpassword");
    var repeatpassword = document.getElementById("repeatpassword");
    var anewbt = document.getElementById("anewbt");
    var anewnumb = document.getElementById("anewnumb");
    // var login_part=document.getElementById('login_part');
    // var findm = document.getElementById("findm");
      if (anewpassword=="") {
              document.getElementById("prompt").innerHTML="<font color='red'>请输入密码<font>";
          }
      else if(anewpassword==repeatpassword){
          document.getElementById("prompt").innerHTML="<font color='green'>两次密码相同</font>";
          document.getElementById("anewbt").disabled = false;
      }
      else{
          document.getElementById("prompt").innerHTML="<font color='red'>两次密码不相同</font>";
          document.getElementById("anewbt").disabled = true;
      }
      if (anewnumb=="") {
      document.getElementById("prompt").innerHTML="<font color='red'>请输入您的电话号码</font>";
      document.getElementById("anewbt").disabled = false;
      }
      else {
          document.getElementById("prompt").innerHTML="";
          document.getElementById("anewbt").disabled = true;
      }
      if (anewbt==true) {
          login_part.style.display="block";
          findm.style.display="none";
      }
    
}